package andy.ham;

import android.app.Activity;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.view.animation.AlphaAnimation;
import android.view.animation.Animation;

import java.util.Timer;
import java.util.TimerTask;

public class AppStart extends Activity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        final View view=View.inflate(this,R.layout.activity_app_start,null);
        setContentView(R.layout.activity_app_start);

//        /*渐变展示启动屏*/
//        AlphaAnimation aa = new AlphaAnimation(0.3f,1.0f);
//        aa.setDuration(2000);
//        view.startAnimation(aa);
//        aa.setAnimationListener(new Animation.AnimationListener()
//        {
//            @Override
//            public void onAnimationEnd(Animation arg0) {
//                //redirectTo();
//            }
//            @Override
//            public void onAnimationRepeat(Animation animation) {}
//            @Override
//            public void onAnimationStart(Animation animation) {}
//
//        });
        /*设置定时器*/
        Timer timer=new Timer();
        TimerTask timerTask=new TimerTask() {
            @Override
            public void run() {
                Intent intent1=new Intent(AppStart.this,LifeDiary.class);
                startActivity(intent1);
                AppStart.this.finish();
            }
        };
        timer.schedule(timerTask,1000*1);
    }

    /**
     * 跳转到...
     */
//    private void redirectTo(){
//        Intent intent = new Intent(AppStart.this, LifeDiary.class);
//        startActivity(intent);
//        finish();
//    }
}
